from django.contrib import admin
from django.contrib.auth.models import Permission, ContentType, Group

# Register your models here.


from django.contrib.auth import get_user_model

from django.contrib.auth.admin import UserAdmin


# 注册用户模型
@admin.register(get_user_model())
class CustomUserAdmin(UserAdmin):
    search_fields = ('username',)


# 注册权限模型
@admin.register(Permission)
class PermissionAdmin(admin.ModelAdmin):
    search_fields = ('codename', 'content_type__app_label', 'content_type__model')

# 注册组模型
admin.site.register(ContentType)
